﻿using Autofac;
using GiaSu.DataAccess.DataContext;
using GiaSu.DataAccess.Entity;
using GiaSu.DataAccess.Repository;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GiaSu.Bussiness.DIConfigure
{
    public class RegisterIoC
    {
        public static void Configure(ContainerBuilder builder)
        {
            builder.RegisterType<DataContext>().As<DbContext>();
            builder.RegisterType<UnitOfWork>().As<IUnitOfWork>();
            builder.RegisterType<GenericRepository<Parent>>().As<IGenericRepository<Parent>>();
            builder.RegisterType<GenericRepository<Grade>>().As<IGenericRepository<Grade>>();
            builder.RegisterType<GenericRepository<Subject>>().As<IGenericRepository<Subject>>();
        }
    }
}
